package logic

import (
	"bw-renting/common"
	"bw-renting/user-rpc/internal/svc"
	"bw-renting/user-rpc/user"
	"context"
	"fmt"
	"github.com/zeromicro/go-zero/core/logx"
)

type UserSendMobileLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewUserSendMobileLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UserSendMobileLogic {
	return &UserSendMobileLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

// Todo:短信发送
func (l *UserSendMobileLogic) UserSendMobile(in *user.UserSendMobileReq) (*user.UserSendMobileRes, error) {
	// todo: add your logic here and delete this line
	mobile := in.Mobile
	code := common.Send(mobile, 6)
	fmt.Println(code)
	return &user.UserSendMobileRes{
		Code: code,
	}, nil
}
